#ifndef __FLASHLED_H__
#define __FLASHLED_H__

// Include necessary libraries
#include "gmsi.h"
#include "userconfig.h"

typedef enum{
    FLASHLED_RESET=0,
    FLASHLED_IDLE,
    FLASHLED_SET,
    FLASHLED_WAITRESPONSE,
    FLASHLED_RECEIVE,
    FLASHLED_TIMEOUT,
}flashstate_e;

// The configuration structure for the flashled object.
typedef struct{
    pfcnWrite Write;
    pfcnRead Read;
    uint32_t wFd;
}flashled_cfg_t;

// The structure for the flashled object.
typedef struct{
    gmsi_base_t *ptBase;
    
    uint32_t wFd;
    pfcnWrite Write;
    pfcnRead Read;
    
    flashstate_e eFlashledState;
    uint8_t chResponseFrame[PROTOCOL_LENGTH];
    uint8_t chTimeoutCount;
    
}flashled_t;

// Function prototypes
int flashled_Init(uintptr_t wObjectAddr, uintptr_t wObjectCfgAddr);

#endif // __FLASHLED_H__